home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1996 #3 / Amiga Plus CD - 1996 - No. 3.iso / demo-versionen / databaseprofessional_v3.0 / picbase / overview2.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-29  |  4KB  |  203 lines

  1. /* Overview.rexx, 11.08.95 Jörg Richter */
  2. /* Stil 2 */
  3.  
  4. OPTIONS RESULTS
  5.  
  6. thumbsize = 126
  7.  
  8. ADDRESS DataBase
  9.  
  10. GetMaskSize
  11. width = WORD(result,1)
  12. height = WORD(result,2)
  13. IF WORDS(size) = 3 THEN
  14.   depth = WORD(size,3)
  15. ELSE
  16.   depth = 8
  17.  
  18. xoff = (width-((width%thumbsize)*thumbsize))%2-12
  19. yoff = (height-((height%thumbsize)*thumbsize))%2-12
  20.  
  21. IF depth = 8 THEN
  22.   LoadGadgets "PicBase/IdxGadgets/"
  23. ELSE
  24.   LoadGadgets "PicBase/IdxGadgetsGray/"
  25.  
  26. doit = 1
  27. stext = "Bitte wählen Sie ..."
  28.  
  29. DO FOREVER
  30.   IF doit = 1 THEN DO
  31.     Current
  32.     nr = result
  33.     CALL Overview
  34.   END
  35.   WaitCommand stext
  36.   command = result
  37.   stext = "Bitte wählen Sie ..."
  38.   doit = 0
  39.   IF WORDS(command) > 1 THEN DO
  40.     mx = WORD(command,1)
  41.     my = WORD(command,2)
  42.     qual = WORD(command,3)
  43.     Current
  44.     ds = result
  45.     IF qual = 10 THEN DO /* Gadget */
  46.       IF mx = 1 THEN DO /* <- */
  47.         nr = nr - (width%thumbsize)*(height%thumbsize)
  48.         IF nr < 1 THEN nr = 1
  49.         Goto nr
  50.         doit = 1
  51.       END
  52.       IF mx = 2 THEN /* -> */
  53.         doit = 1
  54.       IF mx = 8 THEN DO /* Abbruch */
  55.         Goto nr
  56.         Call Cancel
  57.       END
  58.       IF mx > 2 THEN DO
  59.         WaitCommand "Bitte wählen Sie das Bild aus ..."
  60.         command = result
  61.         IF WORDS(command) > 1 THEN DO
  62.           IF mx = 3 THEN qual = 0
  63.           IF mx = 4 THEN qual = 2
  64.           IF mx = 6 THEN qual = 3 /* DTP */
  65.           IF mx = 5 THEN qual = 9 /* Info */
  66.           IF mx = 7 THEN qual = 1
  67.           mx = WORD(command,1)
  68.           my = WORD(command,2)
  69.         END
  70.       END
  71.     END
  72.     IF qual < 10 THEN DO
  73.       select = nr + (mx-xoff-12)%thumbsize + ((my-yoff-12)%(thumbsize+28))*(width%thumbsize)
  74.       Goto select
  75.       IF qual = 1 THEN /* SHIFT */
  76.         Call Cancel
  77.       ELSE DO
  78.         IF qual = 0 THEN
  79.           Execute 1
  80.         IF qual = 3 THEN DO
  81.           GetData $F1
  82.           data = result
  83.           pos = LastPos("/",data)
  84.           CopyToClip LEFT(data,pos) || D2C(10) || SubStr(data,pos+1,Length(data)-pos)
  85.           stext = "Bildname ins ClipBoard kopiert"
  86.         END
  87.         IF qual = 9 THEN DO
  88.           GetData $F1
  89.           fname = result
  90.           GetData $F2
  91.           fsize = result
  92.           GetData $F3
  93.           psize = result
  94.           stext = fname || " (" || fsize || " KBytes, " || psize || ")"
  95.           /* stext = "Dateilänge: " || fsize || " KBytes      Bildgröße: " || psize */
  96.         END
  97.         IF qual = 2 THEN DO /* CTRL */
  98.           GetData $F1
  99.           fname = result
  100.           Mark
  101.           xx = ((mx-xoff-12)%thumbsize)*thumbsize+xoff + 12
  102.           yy = ((my-yoff-12)%(thumbsize+28))*(thumbsize+28)+yoff + 12
  103.           IsMarked
  104.           IF RC = 5 THEN DO
  105.             Box xx yy thumbsize-1 thumbsize-1 1000
  106.             color = 1
  107.             stext = "Bild demarkiert"
  108.             END
  109.           ELSE DO
  110.             Box xx yy thumbsize-1 thumbsize-1 1001
  111.             color = 3
  112.             stext = "Bild markiert"
  113.             END
  114.           fpos = MAX(LastPos("/",fname),LastPos(":",fname))
  115.           fname = UPPER(SubStr(fname,fpos+1,Length(fname)-fpos))
  116.           SetFont Helvetica.font 11 0
  117.           Text xx+1 yy+thumbsize+10 color LEFT fname
  118.           SetFont RESET 0
  119.           END
  120.         Goto ds
  121.         END
  122.       END
  123.     END
  124.   ELSE DO
  125.     IF command = 27 | command = 0 THEN DO /* ESC */
  126.       Goto nr
  127.       Call Cancel
  128.       END
  129.     IF command = 79 THEN DO /* <- */
  130.       nr = nr - (width%thumbsize)*(height%thumbsize)
  131.       IF nr < 1 THEN nr = 1
  132.       Goto nr
  133.       doit = 1
  134.       END
  135.     IF command = 78 | command = 32 THEN /* -> */
  136.       doit = 1
  137.     END
  138. END
  139.  
  140. EXIT
  141.  
  142.  
  143. ShowPicture:
  144.  
  145. ARG xx yy .
  146. GetData $F1
  147. fname = result
  148. GetData $F4
  149. name = result
  150. IsMarked
  151. IF RC = 0 THEN DO
  152.   Box xx+12 yy+12 thumbsize-1 thumbsize-1 1001
  153.   color = 3
  154.   END
  155. ELSE DO
  156.   Box xx+12 yy+12 thumbsize-1 thumbsize-1 1000
  157.   color = 1
  158.   END
  159. LoadPic name xx yy CENTER
  160. fpos = MAX(LastPos("/",fname),LastPos(":",fname))
  161. fname = UPPER(SubStr(fname,fpos+1,Length(fname)-fpos))
  162. SetFont Helvetica.font 11 0
  163. Text xx+13 yy+thumbsize+22 color LEFT fname
  164. SetFont RESET 0
  165.  
  166.  
  167. RETURN
  168.  
  169. Overview:
  170.  
  171. Display On
  172. ClearMask
  173. Display Off
  174. x = xoff
  175. y = yoff
  176.  
  177. weiter = 1
  178. DO WHILE weiter = 1
  179.   CALL ShowPicture x y
  180.   x = x + thumbsize
  181.   IF x > width-thumbsize THEN DO
  182.     IF y < height-(thumbsize*2)-28 THEN DO
  183.       x = xoff
  184.       y = y + thumbsize + 28
  185.       END
  186.     ELSE
  187.       weiter = 0
  188.     END
  189.   RightOne
  190.   IF RC ~= 0 THEN
  191.     weiter = 0
  192. END
  193. RETURN
  194.  
  195.  
  196. Cancel:
  197.  
  198. Display On
  199. LoadGadgets RESET
  200. Show NEW
  201. EXIT
  202.  
  203.